package thread;

public class Demo4 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(new Runnable(){
            @Override
            public void run() {
                while (true){
                    System.out.println("Hello Thread");
                    try {
                        Thread.sleep(100);
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
                }
            }
        });
        t1.start();
        while (true){
            System.out.println("Hello Main");
            Thread.sleep(100);
        }
    }
}
